Api.ConfigureDc method
Configures distributed clock (DC) options. Distributed clocks allow the synchronization of the slave cycles with the KINGSTAR cycle. It is highly recommended for any motion application to avoid vibrations.
- Master Shift: the reference clock is the clock of the first slave in the EtherCAT network with the DC capability.
- Bus Shift: the reference clock is the master's clock.
Namespace: IntervalZero.KINGSTAR.Local.Api
Assembly: IntervalZero.KINGSTAR.Local.Api (in IntervalZero.KINGSTAR.Local.dll) Version: 4.4.0.0
Syntax
public KsError ConfigureDc(
bool Active,
bool CheckStatus,
bool MasterShift,
int ReferenceIndex
)
Public Function ConfigureDc(
Active As Boolean,
CheckStatus As Boolean,
MasterShift As Boolean,
ReferenceIndex As Integer
) As KsError
Parameters
Active
Type: bool
true to enable, and false to disable DC synchronization. By default, it is true.
CheckStatus
Type: bool
Enables checking of the DC jitter during startup. The devices will go to the operational state (Op) once the synchronization is done. This slows the startup around 15 seconds. By default, it is true.
MasterShift
Type: bool
Chooses the shift mode. true: Master Shift. false: Bus Shift. By default, it is false.
Bus Shift means that the EtherCAT slaves follow the master (computer) clock. Master Shift means the slaves and the master follow one of the slaves called "Reference Clock." By default, the Reference Clock will be the first slave on the bus that supports DC.
NOTE: The slave clocks may be more precise than the computer clock so Master Shift is more stable. However, Master Shift modifies the computer clock's speed which impacts all time stamps done on the computer. This can be a problem if there are other protocols used on the same computer.
ReferenceIndex
Type: int
Selects which device is the reference clock. This parameter is a slave ID, which is the EtherCAT ID of a device. It corresponds to the position of the device in the EtherCAT loop. The ID is zero based and is not affected by aliasing.
NOTE: ReferenceIndex has not been implemented yet.
Return value
A return code of a method.
Remarks
- This method must be called after Create or CreateAsync and before Start.
- Disabling DC checks can reduce the startup time by 10 seconds, but no longer guarantee that the synchronization is ready once the system is started. It takes about 1 minute for the clocks to synchronize after the system is in the operational state (Op). We suggest you keep it enabled.
- In Master Shift, the slaves are more stable but the master is less stable. Master Shift should be used only if needed.
Usable EtherCAT states
ecatOffline
Examples
N/A
See also